package ruru.client.ui.widgets.sortableTable;

import com.google.gwt.user.client.ui.HTML;

/**
 * Subclass of gwt HTML that is comparable for use in SortableTable. Specifically contains only a double in String form.
 * 
 * @author zane.tian@gmail.com
 */
public class ComparableHTML extends HTML implements Comparable {
	private Double d;

	public ComparableHTML(String html) {
		super(html);
		this.d = new Double(Double.parseDouble(html));
	}
	
	public Double getStoredDouble() {
		return d;
	}

	public int compareTo(Object arg0) {
		ComparableHTML target = (ComparableHTML) arg0;
		return d.compareTo(target.d);
	}
}